<template>
  <view class="pd-box">
    <view class="userInfo-component">
      <view class="top-layout">
        <view class="avatar">
          <image src="/static/login.jpg" class="user-avatar-img"></image>
          <text class="iconfont icon-zujian-shoujihao"></text>
        </view>
        <view class="user-info">
          <view class="user-name-info">
            <view class="user-name">腾讯次顶级hi</view>
            <view class="user-vip">VIP1</view>
            <view class="user-other">竖剧通</view>
            <text class="iconfont end-icon icon-weibiaoti--34"></text>
          </view>
          <view class="user-points">
            <text class="points">积分：0</text>
            <text class="points">钻石：0</text>
          </view>
        </view>
        <view class="iconfont icon-vip"></view>
      </view>
      <view class="bottom-layout">
        <view class="other-info" v-for="(item, index) in infoList" :key="index">
          <text class="other-title">{{ item.title }}</text>
          <text class="other-des">{{ item.des }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { defineComponent, reactive, toRefs } from "vue";

export default defineComponent({
  name: "userInfo001",
  props: {},
  components: {},
  setup() {
    const data = reactive({
      infoList: [
        { title: "视频VIP", des: "19元开通SVIP" },
        { title: "体育VIP", des: "新人16元看比赛" },
        { title: "其他套餐", des: "TOPSWH卡上新" },
      ],
    });
    return {
      ...toRefs(data),
    };
  },
});
</script>

<style scoped lang="less">
.pd-box{
  padding:0 10rpx;
}
.userInfo-component {
  padding: 30rpx;
  background: #f0d99a;
  border-radius: 26rpx;
  .top-layout {
    display: flex;
    flex-direction: row;
    .avatar {
      width: 100rpx;
      height: 100rpx;

      position: relative;
      .user-avatar-img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        overflow: hidden;
      }
      .icon-zujian-shoujihao {
        position: absolute;
        right: -6rpx;
        bottom: 0;
        color: #fff;
        background: #58bfc0;
        border-radius: 50%;
        font-size: 22rpx;
        padding: 3rpx;
        overflow: hidden;
      }
    }
    .user-info {
      flex: 1;
      margin-left: 20rpx;
      margin-top: 6rpx;
      .user-name-info {
        display: flex;
        flex-direction: row;
        justify-content: start;
        align-items: center;
        // 居中
        .user-name {
          font-size: 32rpx;
          color: #8b4b1f;
        }
        .user-vip {
          font-size: 22rpx;
          height: 30rpx;
          line-height: 30rpx;
          color: #000;
          background: #f8e3a2;
          border-radius: 6rpx;
          font-weight: 700;
          padding: 0 6rpx;
          margin: 0 6rpx;
        }
        .user-other {
          font-size: 20rpx;
          height: 30rpx;
          line-height: 30rpx;
          color: #fff;
          background: #dc6f63;
          border-radius: 6rpx;
          padding: 0 6rpx;
        }
        .icon-weibiaoti--34 {
          display: block;
          width: 26rpx;
          height: 26rpx;
          line-height: 26rpx;
          margin-left: 20rpx;
          text-align: center;
          border-radius: 13rpx;
          background: #e9d09b;
          margin-top: 3rpx;
          font-size: 24rpx;
          font-weight: 700;
          color: #894a20;
        }
      }
      .user-points {
        display: flex;
        flex-direction: row;
        justify-content: start;
        color: #b4834a;
        font-size: 26rpx;
        font-weight: 500;
        margin-top: 6rpx;
        .points {
          margin-right: 20rpx;
          font-size: 24rpx;
        }
      }
    }
    .icon-vip {
      font-size: 80rpx;
      color: #8c4a1e;
    }
  }
  .bottom-layout {
    display: flex;
    // 横向3等分、
    flex-direction: row;
    justify-content: space-between;
    margin-top: 30rpx;
    .other-info {
      display: flex;
      flex-direction: column;
      justify-content: start;
      align-items: start;
      text-align: left;
      font-size: 24rpx;
      font-weight: 500;
      color: #8c4a1e;
      text-align: left;
      text-overflow: ellipsis;
      white-space: nowrap;
      .other-title {
        color: #935627;
        font-size: 30rpx;
      }
      .other-des {
        margin-top: 10rpx;
        color: #b1834a;
        font-size: 24rpx;
      }
    }
  }
}
</style>
